
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)


project(monitor)
#add_definitions("-Wall -g")
MESSAGE(STATUS "Project: SERVER") 
SET(CMAKE_SYSTEM_NAME Linux) 
SET(TOOLCHAIN_DIR "/opt/arm-linux-gcc/arm-linux-gnueabihf")
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_BUILD_TYPE Release)
#include_directories("${TOOLCHAIN_DIR}/libc/usr/include/asm-generic")
include_directories("./arm-lib/mqtt/mqtt-h")
include_directories("./arm-lib/sqlite3")

link_directories("./arm-lib/mqtt")
link_directories("./arm-lib/sqlite3")

link_libraries("libpaho-mqtt3a-static.a")
link_libraries("libpaho-mqtt3c-static.a")
link_libraries("libsqlite3.so")

AUX_SOURCE_DIRECTORY(./src SRC_LIST)

 
ADD_EXECUTABLE(monitor ${SRC_LIST})

TARGET_LINK_LIBRARIES(monitor dl)
TARGET_LINK_LIBRARIES(monitor pthread)
TARGET_LINK_LIBRARIES(monitor libpaho-mqtt3a-static.a)
TARGET_LINK_LIBRARIES(monitor libpaho-mqtt3c-static.a)
TARGET_LINK_LIBRARIES(monitor rt)
TARGET_LINK_LIBRARIES(monitor m)



